import { createRouter,createWebHistory } from 'vue-router'

const routes = [
    {
        path: '/',
        name: 'home',
        component: () => import('../views/Home.vue'),
        // show 代表是否要在当前导航栏中展示，true展示，false不展示
        meta: { title: '首页', show: true, icon:'HomeFilled',useFrame:true}
    },
    {
        path: '/moveshop',
        name: 'moveshop',
        component: () => import('../views/MoveShop.vue'),
        // show 代表是否要在当前导航栏中展示，true展示，false不展示
        // useFrame 代表是否要全屏 false 代表全屏 true 代表不全屏
        meta: { title: '首页', show: false, icon: 'HomeFilled' , useFrame : false}
    },
    {
        path: '/product',
        component: () => import('@/views/product/Index.vue'),
        meta: { title: '商品管理', show: true, icon: 'Briefcase' },
        children: [
            {
                path: '/product/list',
                name: 'product-list',
                component: () => import('@/views/product/List.vue'),
                meta: { title: '商品列表',show: true, icon: 'List' }
            },
            {
                path: '/product/add',
                name: 'product-add',
                component: () => import('@/views/product/Add.vue'),
                meta: { title: '商品添加', show: true, icon: 'Plus' }
            },
            {
                path: '/product/edit',
                name: 'product-edit',
                component: () => import('@/views/product/Edit.vue'),
                meta: { title: '商品修改', show: true, icon: 'Edit' }
            }
            
        ]
    },
    {
        path: '/category',
        component: () => import('@/views/category/Index.vue'),
        meta: { title: '类目管理', show: true, icon: 'Operation' },
        children: [
            {
                path: '/category/list',
                name: 'category-list',
                component: () => import('@/views/category/List.vue'),
                meta: { title: '类目列表', show: true, icon: 'List' }
            },
            {
                path: '/category/add',
                name: 'category-add',
                component: () => import('@/views/category/Add.vue'),
                meta: { title: '类目添加', show: true, icon: 'Plus' }
            },
            {
                path: '/category/edit',
                name: 'category-edit',
                component: () => import('@/views/category/Edit.vue'),
                meta: { title: '类目修改', show: true, icon: 'Edit' }
            }

        ]
    }
]

const router =createRouter({
    history: createWebHistory(),
    routes
   
})
export default router;